package com.mef.smsplat.eterm.util;

public class EtermUtil {
	/**
	 * 检测是否还需要做PN指令
	 * @param ret 返回的结果
	 * @return true为需要，false为不需要
	 */
	public static boolean checkNeedPn(String ret)
	{
		if(ret.indexOf("+")!=-1) return true;
		return false;
	}
	
	/**
	 * 处理看不见的SB字符
	 * @param ret
	 * @return
	 */
	public static String dealResult(String ret)
	{
		byte[] b03 = {3};
		String s03 = new String(b03);
		byte[] b30 = {30};
		String s30 = new String(b30);
		byte[] b13 = {13};
		String s13 = new String(b13);
		byte[] b10 = {10};
		String s10 = new String(b10);
		ret = ret.replace(s03, "").replace(s30, "");
		ret = ret.replace(s10, s13);
		
		while(ret.contains(s13+s13)) ret = ret.replace(s13+s13, s13);
		
		return ret;
	}
}
